package com.model;

// Generated 15 f�vr. 2013 15:56:26 by Hibernate Tools 4.0.0

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Famille generated by hbm2java
 */
@Entity
@Table(name = "Famille", schema = "dbo", catalog = "CRM")
public class Famille implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private int familleId;
	private String libelle;
	private Set<FamilleEnquete> familleEnquetes = new HashSet<FamilleEnquete>(0);
	private Set<Item> items = new HashSet<Item>(0);

	public Famille() {
	}

	public Famille(int familleId) {
		this.familleId = familleId;
	}

	public Famille(int familleId, String libelle, Set<FamilleEnquete> familleEnquetes, Set<Item> items) {
		this.familleId = familleId;
		this.libelle = libelle;
		this.familleEnquetes = familleEnquetes;
		this.items = items;
	}

	@Id
	@GeneratedValue
	@Column(name = "familleId", unique = true, nullable = false)
	public int getFamilleId() {
		return this.familleId;
	}

	public void setFamilleId(int familleId) {
		this.familleId = familleId;
	}

	@Column(name = "libelle", length = 100)
	public String getLibelle() {
		return this.libelle;
	}

	public void setLibelle(String libelle) {
		this.libelle = libelle;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "famille")
	public Set<FamilleEnquete> getFamilleEnquetes() {
		return this.familleEnquetes;
	}

	public void setFamilleEnquetes(Set<FamilleEnquete> familleEnquetes) {
		this.familleEnquetes = familleEnquetes;
	}

	@ManyToMany(fetch = FetchType.LAZY)
	@JoinTable(name = "FamilleItem", schema = "dbo", catalog = "CRM", joinColumns = { @JoinColumn(name = "familleId", nullable = false, updatable = false) }, inverseJoinColumns = { @JoinColumn(name = "ItemId", nullable = false, updatable = false) })
	public Set<Item> getItems() {
		return this.items;
	}

	public void setItems(Set<Item> items) {
		this.items = items;
	}

}
